import asyncio

async def task(n):
    await asyncio.sleep(n)  # Simulate variable work time
    return n

async def main():
    tasks = {asyncio.create_task(task(2)), asyncio.create_task(task(1)), asyncio.create_task(task(3))}
    
    # Wait for the tasks to complete
    done, pending = await asyncio.wait(tasks)

    print(f'Done tasks: {[t.result() for t in done]}')
    print(f'Pending tasks: {len(pending)}')

asyncio.run(main())